def rectangle_asterisks(m, n):
    for i in range(0, m):
        for j in range(0, n):
            print('*', end='')
        print()


print('for循环实现8Ｘ4的星阵矩形:')
rectangle_asterisks(4, 8)

def triangle_asterisks(n):
    for i in range(0, n):
        for j in range(0, i + 1):
            print('*', end='')
        print()


print('for循环实现6行的星阵直角三角形:')
triangle_asterisks(6)

print('图形服务')
while True:
    print("""\
1 - rectangle
2 - triangle
3 - exit
""")
    x = int(input('Your choice: '))
    if 1 == x:
        rectangle_asterisks(4, 8)
    elif 2 == x:
        triangle_asterisks(6)
    elif 3 == x:
        break
    else:
        print('Wrong choice, plz input again.')
